package avpc

import (
	"fmt"

	"github.com/aliyun/alibaba-cloud-sdk-go/services/vpc"
)

// AssociateEipAddress绑定弹性公网
func (c *Client) AssociateEipAddress(req *vpc.AssociateEipAddressRequest) (*vpc.AssociateEipAddressResponse, error) {
	client := c.Client
	req.Method = "GET"
	req.Port = c.Port
	response, err := client.AssociateEipAddress(req)
	if err != nil {
		return nil, fmt.Errorf("Error creating instance %w", err)
	}

	return response, nil
}
